<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #rotate{
            width: 100px;
            height: 100px;
            background-color: #0b97c4;
            transition: all 1s;
        }
    </style>
</head>
<body>
    <div id="rotate"></div>
    <script src="../jquery-3.1.1.min.js"></script>
    <script>
        var $el = document.querySelector('#rotate');
        $el.addEventListener('click', function () {
            var $ele = $($el),
                style = $ele.attr("style");
            if (!style || style === "") {
                $ele.attr("style", "transform: rotate(720deg);");
            } else {
                var re = /rotate\((\d+)deg\)/ig;
                var r = re.exec(style);
                $ele.attr("style", "transform: rotate(" + (parseInt(r[1]) + 720) + "deg);");
            }
        }, false);

    </script>
    
</body>
</html>